<template>
  <uni-popup ref="fillState" type="center" :is-mask-click="false">
    <view class="fillState">
      <view style="margin-bottom: 20rpx">备注</view>
      <input class="uni-input" placeholder="请输入备注" v-model="note" />
      <Button @cancel="closeBankPad" @confirm="submit()" style="margin-top: 20rpx"></Button>
    </view>
  </uni-popup>
</template>

<script setup lang="ts">
  import Button from './buttom.vue';
  import { errorToast } from '@/utils/prompt';
  import { ref } from 'vue';
  const emit = defineEmits(['submit']);
  const note = ref('')
  const fillState = ref(null)
  function submit() {
    closeBankPad();
    if (!note.value) {
      errorToast('请输入司机价');
    } else {
      emit('submit', note.value);
    }
  }
  // 开关修改退款金额弹框
  function openBankPad() {
    note.value = '';
    fillState.value.open();
  }
  function closeBankPad() {
    fillState.value.close();
  }
  defineExpose({ openBankPad });
</script>

<style scoped lang="less">
  .fillState {
    width: 650rpx;
    background-color: white;
    border-radius: 5px;
    padding: 30rpx 30rpx 40rpx 30rpx;
    box-sizing: border-box;
  }

  input {
    width: 100%;
    height: 62rpx;
    background: #ecf0f6;
    border-radius: 5px;
    padding-left: 20rpx;
    box-sizing: border-box;
    margin: 0rpx 0px 40rpx;
  }
</style>